﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Presentation.ServiceAgent.MembershipServiceAgent;

namespace MVC4.Presentation.Models
{
    public static class AccountModelExtension
    {

      public static  RegisterModel ToModel(this Membership newMember)
        {

            if (newMember == null) return null;
            return new RegisterModel();
        }

      public static Membership ToMember(this RegisterModel model)
        {
            if (model == null) return null;
            return new Membership()
            {
                User = new User()
                {
                    UserName = model.UserName
                },
                Password=model.Password,
                Email=model.Email
            };
        }
    }
}